//
//  SetViewController.m
//  Drawer
//
//  Created by 高振权 on 15/4/22.
//  Copyright (c) 2015年 Jiarui Han. All rights reserved.
//

#import "SetViewController.h"
#import "ShareIt.h"
@interface SetViewController ()

@end

@implementation SetViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    [self popToLast];
    [self cretaButton];
    // Do any additional setup after loading the view.
}

- (void)popToLast
{
    UIPanGestureRecognizer *pan = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(returnToLast:)];
    [self.view addGestureRecognizer:pan];
}

- (void)returnToLast:(id)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)cretaButton
{
    UIButton *button = [[[UIButton alloc] initWithFrame:CGRectMake(20, 20, 30, 30)] autorelease];
    button.backgroundColor = [UIColor redColor];
    [button addTarget:self action:@selector(shareit:) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];
}

- (void)shareit:(id)sender
{
    [ShareIt shareIt:sender];
}


@end
